home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / misc / xlist_s.lha / xlist_s / xList-GUI_104.s < prev   
Text File  |  1995-09-27  |  17KB  |  1,093 lines

  1. ; xList-GUI v1.04 (27-Sep-95), an user-friendly (and cheap) GUI frontend for
  2. ; xList (allow recursivity...)
  3. ;(guide in util/misc/xList104.lha)
  4.  
  5.     include    dos/dos.i
  6.     include    dos/var.i
  7.     include    lvo/lvos.i
  8.     include    reqtools/reqtools_lib.i
  9.     include    reqtools/reqtools.i
  10.     include    exec/execbase.i
  11.     include    exec/exec.i
  12.     include    exec/types.i
  13.  
  14. GOOD_FILE    equ    1
  15. NOT_PICKED    equ    0
  16. VARSIZE        equ    8
  17.  
  18.  
  19. CALL    MACRO
  20.     jsr    _LVO\1(a6)
  21.     ENDM
  22.  
  23.    STRUCTURE xListGUI_Vars,0
  24.       ULONG xl_dosbase
  25.       ULONG xl_rtbase
  26.       ULONG xl_wbstartup
  27.       ULONG xl_filereq
  28.       ULONG xl_membase
  29.       ULONG xl_fib
  30.       ULONG xl_size
  31.       ULONG xl_lock
  32.       ULONG xl_oldlock
  33.       ULONG xl_tmplock
  34.       ULONG xl_txtdirlock
  35.       ULONG xl_txtlock
  36.       ULONG xl_introfile
  37.       ULONG xl_introdir
  38.       ULONG xl_endfile
  39.       ULONG xl_enddir
  40.       ULONG xl_txtfh
  41.       ULONG xl_txtbuffer
  42.       ULONG xl_oldlock2
  43.       ULONG xl_rdargs
  44.       ULONG xl_argsarray
  45.       ULONG xl_introtxt
  46.       ULONG xl_endtxt
  47.       ULONG xl_append
  48.       ULONG xl_noroot
  49.       ULONG xl_switch
  50.       ULONG xl_listfh
  51.       ULONG xl_dirtoscan
  52.       ULONG xl_varbuff
  53.       ULONG xl_prvarargv
  54.       ULONG xl_bigtotal
  55.       ULONG xl_onedirtot
  56.       ULONG xl_varfh
  57.       ULONG xl_bigvarbuff
  58.       ULONG xl_statfh
  59.       STRUCT xl_typecom_buff,255
  60.       LABEL xl_SIZEOF
  61.  
  62.  
  63.  
  64. progstart
  65.     bra    pstart
  66.  
  67. version
  68.     dc.b    '$VER:'
  69. title
  70.     dc.b    ' xList-GUI v1.04 (27.09.95)',0
  71.     even
  72.  
  73. pstart
  74.     move.l    4.w,a6
  75.     move.l    #xl_SIZEOF+108+fib_SIZEOF,d0
  76.     move.l    #$10001,d1
  77.     CALL    AllocVec
  78.     move.l    d0,a4
  79.     bne    memallocated
  80.  
  81.     bsr    getwbmsg
  82.     move.l    d0,a1
  83.     beq    cliexit2
  84.     CALL    Forbid
  85.     CALL    ReplyMsg
  86. cliexit2
  87.     moveq    #103,d0
  88.     rts
  89.  
  90. memallocated
  91.     add.l    #xl_SIZEOF,d0
  92.     move.l    d0,xl_membase(a4)
  93.  
  94.     add.l    #108,d0
  95.     move.l    d0,xl_fib(a4)
  96.  
  97. wb
  98.     moveq    #0,d0
  99.     bsr    getwbmsg
  100.     move.l    d0,xl_wbstartup(a4)
  101.  
  102.     lea    dosname(pc),a1
  103.     moveq    #36,d0
  104.     CALL    OpenLibrary
  105.     move.l    d0,xl_dosbase(a4)
  106.     beq    replymsg
  107.  
  108. prog
  109.     lea    rtname(pc),a1
  110.     moveq    #0,d0
  111.     CALL    OpenLibrary
  112.     move.l    d0,xl_rtbase(a4)
  113.     beq    closedos
  114.  
  115. testprg
  116.     lea    xlistname(pc),a0
  117.     bsr    lockfile
  118.     bne    unlockprg
  119.  
  120.     lea    segname(pc),a0
  121.     bsr    lockfile
  122.     bne    unlockprg
  123.  
  124.     lea    body8(pc),a1
  125.     lea    button8(pc),a2
  126.     bsr    disp_req
  127.     bra    closert
  128.  
  129. unlockprg
  130.     move.l    d0,d1
  131.     CALL    UnLock
  132.  
  133. findseg ; if xList is not yet resident
  134.     lea    segname(pc),a0
  135.     move.l    a0,d1
  136.     moveq    #0,d2
  137.     moveq    #0,d3
  138.     CALL    FindSegment ; search
  139.     tst.l    d0
  140.     bne    readargs
  141.  
  142.     lea    xlistname(pc),a0
  143.     move.l    a0,d1
  144.     CALL    LoadSeg ; load code
  145.     tst.l    d0
  146.     bne    addseg
  147.  
  148.     lea    segname(pc),a0
  149.     move.l    a0,d1
  150.     CALL    LoadSeg ; load code
  151.     tst.l    d0
  152.     beq    readargs
  153.  
  154. addseg
  155.     move.l    d0,d2
  156.     lea    segname(pc),a0
  157.     move.l    a0,d1
  158.     moveq    #1,d3
  159.     CALL    AddSegment ; make resident
  160.  
  161. readargs
  162.     bsr    teststat
  163.     bsr    deletebigvar
  164.     bsr    getbig
  165.     lea    template(pc),a0
  166.     move.l    a0,d1
  167.     lea    xl_argsarray(a4),a0
  168.     move.l    a0,d2
  169.     moveq    #0,d3
  170.     move.l    xl_dosbase(a4),a6
  171.     CALL    ReadArgs
  172.     move.l    d0,xl_rdargs(a4)
  173.     beq    closert
  174.     tst.l    xl_argsarray(a4)
  175.     beq    req1
  176.     move.b    #1,xl_switch(a4)
  177.     move.l    xl_argsarray(a4),a5
  178.     move.l    (a5)+,xl_dirtoscan(a4)
  179.     bra    phase2
  180.  
  181.  
  182. req1
  183.     move.l    #RT_FILEREQ,d0
  184.     sub.l    a0,a0
  185.     move.l    xl_rtbase(a4),a6
  186.     CALL    rtAllocRequestA
  187.     move.l    d0,xl_filereq(a4)
  188.     bne.s    frallocated
  189.  
  190.     lea    body1(pc),a1
  191.     lea    button1(pc),a2
  192.     bsr    disp_req
  193.     bra    freeargs
  194.  
  195. frallocated
  196.     moveq    #0,d0
  197.     move.l    d0,xl_txtdirlock(a4)
  198.     move.l    d0,xl_txtlock(a4)
  199.     move.l    d0,xl_introfile(a4)
  200.     move.l    d0,xl_introdir(a4)
  201.     move.l    d0,xl_endfile(a4)
  202.     move.l    d0,xl_enddir(a4)
  203.  
  204. welcome
  205.     lea    body2(pc),a1
  206.     lea    button2(pc),a2
  207.     bsr    disp_req
  208.     tst.l    d0
  209.     beq    freereq2
  210.  
  211.     cmpi.l    #1,d0
  212.     beq    req4txt ; ***** INTRO/END TEXTS   DISABLED ********
  213.     beq    popupfr
  214.  
  215.     lea    body6(pc),a1
  216.     lea    button6(pc),a2
  217.     bsr    disp_req
  218.  
  219.     lea    body7(pc),a1
  220.     lea    button7(pc),a2
  221.     bsr    disp_req
  222.     bra    welcome
  223.  
  224.  
  225. req4txt
  226.     lea    body9(pc),a1
  227.     lea    button9(pc),a2
  228.     bsr    disp_req
  229.     cmpi.l    #1,d0
  230.     beq    popupfr
  231.     cmpi.l    #2,d0
  232.     beq    reqintro
  233.  
  234. reqend
  235.     bsr    choose
  236.     tst.l    d0
  237.     beq    req4txt
  238.     move.l    xl_txtdirlock(a4),xl_enddir(a4)
  239.     move.l    xl_txtlock(a4),xl_endfile(a4)
  240.     bra    req4txt
  241.  
  242. choose
  243.     move.l    xl_filereq(a4),a1
  244.     move.l    xl_membase(a4),a2
  245.     clr.b    (a2)
  246.     lea    text2(pc),a3
  247.     move.l    xl_rtbase(a4),a6
  248.     CALL    rtFileRequestA
  249.     tst.l    d0
  250.     bne.s    selected
  251.  
  252.     moveq    #NOT_PICKED,d0
  253.     rts
  254.  
  255. selected
  256.     move.l    xl_filereq(a4),a0
  257.     move.l    rtfi_Dir(a0),a0
  258.  
  259.     bsr    lockfile ; locking dir
  260.  
  261.     bne    txtdirlocked
  262.  
  263.     ;    lea    body4(pc),a1
  264.     ;    lea    button4(pc),a2
  265.     ;    bra    disp_req
  266.  
  267.     moveq    #NOT_PICKED,d0
  268.     rts
  269.  
  270. txtdirlocked
  271.     move.l    d0,xl_txtdirlock(a4)
  272.  
  273.  
  274.     ;    move.l    xl_txtdirlock(a4),d1
  275.     ;    CALL    UnLock
  276.     ;    rts
  277.  
  278.     move.l    d0,d1
  279.     move.l    xl_dosbase(a4),a6
  280.     CALL    CurrentDir
  281.     move.l    d0,xl_oldlock2(a4)
  282.  
  283.     move.l    xl_membase(a4),a0
  284.     ;    move.l    a0,-(sp)
  285.     bsr    lockfile ;         lock file
  286.     beq    txtnotlocked
  287.  
  288. txtlocked
  289.     move.l    d0,xl_txtlock(a4)
  290.     move.l    xl_oldlock2(a4),d1
  291.     move.l    xl_dosbase(a4),a6
  292.     CALL    CurrentDir
  293.     move.l    d0,d1
  294.     CALL    UnLock
  295.     moveq    #GOOD_FILE,d0
  296.     rts
  297.  
  298.  
  299.     ;    move.l    xl_txtlock(a4),d1
  300.     ;    CALL    UnLock
  301.  
  302. txtnotlocked
  303.     move.l    xl_oldlock2(a4),d1
  304.     move.l    xl_dosbase(a4),a6
  305.     CALL    CurrentDir
  306.     move.l    d0,d1
  307.     CALL    UnLock
  308.     moveq    #NOT_PICKED,d0
  309.     rts
  310.  
  311.  
  312.  
  313. nopicked
  314.     lea    body3(pc),a1
  315.     lea    button10(pc),a2
  316.     bra    disp_req
  317.  
  318. reqintro
  319.     bsr    choose
  320.     tst.l    d0
  321.     beq    req4txt
  322.     move.l    xl_txtdirlock(a4),xl_introdir(a4)
  323.     move.l    xl_txtlock(a4),xl_introfile(a4)
  324.     bra    req4txt
  325.  
  326. popupfr
  327.     move.l    xl_filereq(a4),a1
  328.     move.l    xl_membase(a4),a2
  329.     clr.b    (a2)
  330.     lea    text1(pc),a3
  331.     lea    tags1(pc),a0
  332.     move.l    xl_rtbase(a4),a6
  333.     CALL    rtFileRequestA
  334.     tst.l    d0
  335.     bne.s    picked
  336.  
  337.     lea    body3(pc),a1
  338.     lea    button3(pc),a2
  339.     bsr    disp_req
  340.     tst.l    d0
  341.     bne    freereq2
  342.     bra    welcome
  343.  
  344. picked
  345.     move.l    xl_filereq(a4),a0
  346.     move.l    rtfi_Dir(a0),xl_dirtoscan(a4)
  347. ;    bsr    freereq
  348.     bra    phase2
  349.  
  350. freereq2
  351.     bsr    freereq
  352.     bra    freeargs
  353.  
  354.  
  355. freereq
  356.     move.l    xl_filereq(a4),a1
  357.     move.l    xl_rtbase(a4),a6
  358.     jmp    _LVOrtFreeRequest(a6)
  359.  
  360. phase2
  361.     move.l    xl_dirtoscan(a4),a0
  362.     bsr    lockfile
  363.     move.l    d0,xl_lock(a4)
  364.     bne    dirlocked
  365.  
  366.     tst.b    xl_switch(a4)
  367.     bne    befloop
  368.  
  369.     lea    body4(pc),a1
  370.     lea    button4(pc),a2
  371.     bsr    disp_req
  372.     tst.l    d0
  373.     beq    freeargs
  374.     bra    req1
  375.  
  376.  
  377. dirlocked
  378.     move.l    xl_lock(a4),d1
  379.     move.l    xl_dosbase(a4),a6
  380.     CALL    CurrentDir
  381.     move.l    d0,xl_oldlock(a4)
  382.  
  383.     lea    outname(pc),a0
  384.     bsr    lockfile
  385.     beq    noprev
  386.  
  387.     move.l    d0,d1
  388.     CALL    UnLock
  389.  
  390.     tst.l    xl_switch(a4)
  391.     beq    append_req
  392.  
  393.     tst.l    xl_append(a4)
  394.     bne    noprev
  395.     bra    testdest
  396.  
  397. append_req
  398.     lea    body5(pc),a1
  399.     lea    button5(pc),a2
  400.     bsr    disp_req
  401.  
  402.     tst.l    d0
  403.     beq    current
  404.  
  405.     cmpi.l    #1,d0
  406.     beq    noprev
  407.  
  408.  
  409. testdest
  410.     lea    outname2(pc),a0
  411.     bsr    lockfile
  412.     beq    rename
  413.  
  414.     move.l    d0,d1
  415.     CALL    UnLock
  416.  
  417.     lea    outname2(pc),a0
  418.     add.b    #1,14(a0)
  419.     bra.s    testdest
  420.  
  421.  
  422. rename
  423.     lea    outname(pc),a0
  424.     move.l    a0,d1
  425.     lea    outname2(pc),a0
  426.     move.l    a0,d2
  427.     move.l    xl_dosbase(a4),a6
  428.     CALL    Rename
  429.  
  430. noprev ; ****** Beginning of the serious stuff ******\\\\\\\\\\\\\\\\\\\\\
  431.     bsr    printintro
  432.     clr.l    xl_introfile(a4)
  433.  
  434.     lea    comline1(pc),a0 ; List >T:xltmp1 lformat "xList >>RAM:xList_out
  435.     bsr    execute
  436.  
  437.     lea    tmpname(pc),a0
  438.     bsr    lockfile
  439.     move.l    d0,xl_tmplock(a4)
  440.     beq    current
  441.  
  442.     move.l    d0,d1
  443.     move.l    xl_fib(a4),d2
  444.     CALL    Examine
  445.  
  446.  
  447.     move.l    xl_fib(a4),a0
  448.     tst.l    fib_Size(a0)
  449.     bne    nonull
  450.  
  451.     move.l    xl_tmplock(a4),d1
  452.     CALL    UnLock
  453.  
  454.     lea    dummycom(pc),a0
  455.     bsr    execute
  456.  
  457.     bsr    printend
  458.     clr.l    xl_endfile(a4)
  459.  
  460.     bra    current
  461.  
  462. nonull
  463.     move.l    xl_tmplock(a4),d1
  464.     CALL    UnLock
  465.  
  466.     tst.l    xl_switch(a4)
  467.     beq    rootreq
  468.  
  469.     tst.l    xl_noroot(a4)
  470.     beq    root
  471.     bra    com2
  472.  
  473. rootreq
  474.     lea    body11(pc),a1
  475.     lea    button11(pc),a2
  476.     bsr    disp_req
  477.  
  478.     tst.l    d0
  479.     beq    com2
  480.  
  481. root
  482.     lea    dummycom(pc),a0
  483.     bsr    execute
  484.  
  485. com2
  486.     lea    comline2(pc),a0
  487. ;    dc.b    'Sort >NIL: T:xl_tmp1 to T:xl_tmp4',10,'Execute >NIL:'
  488. ;    dc.b    ' T:xl_tmp4',0
  489.  
  490.     bsr    execute
  491.  
  492.     bsr    printend
  493.  
  494.     lea    tmpname(pc),a0
  495.     move.l    a0,d1
  496.     CALL    DeleteFile
  497.  
  498.     lea    sortedname(pc),a0
  499.     move.l    a0,d1
  500.     CALL    DeleteFile
  501.  
  502. current
  503.     move.l    xl_oldlock(a4),d1
  504.     move.l    xl_dosbase(a4),a6
  505.     CALL    CurrentDir
  506.     move.l    d0,d1
  507.     CALL    UnLock
  508.  
  509.  
  510. befloop ; scanning finished, next dir (CLI) or mainmenu (GUI)
  511.  
  512.     bsr    gettotal ; stats stuff
  513.  
  514.     tst.b    xl_switch(a4)
  515.     beq    frallocated
  516.  
  517.     move.l    (a5)+,xl_dirtoscan(a4)
  518.     beq    freeargs
  519.  
  520.     bra    phase2 ; scan the next dir
  521.  
  522. freeargs
  523.     move.l    xl_rdargs(a4),d1
  524.     move.l    xl_dosbase(a4),a6
  525.     CALL    FreeArgs
  526.  
  527.     bsr    closestats
  528.  
  529.  
  530. closert
  531.     move.l    xl_rtbase(a4),a1
  532.     move.l    4.w,a6
  533.     CALL    CloseLibrary
  534.  
  535. closedos
  536.     move.l    xl_dosbase(a4),a1
  537.     move.l    4.w,a6
  538.     CALL    CloseLibrary
  539.  
  540.  
  541. replymsg
  542.     move.l    xl_wbstartup(a4),d0
  543.     beq.s    CLIExit
  544.     move.l    d0,a1
  545.     CALL    Forbid
  546.     CALL    ReplyMsg
  547.  
  548. CLIExit
  549.     move.l    a4,a1
  550.     CALL    FreeVec
  551.  
  552. exit
  553.     moveq    #0,d0
  554.     rts ; My Friend This Is The End.
  555.  
  556. ;************************** misc subroutines
  557. getwbmsg
  558.     move.l    ThisTask(a6),a5
  559.     tst.l    pr_CLI(a5)
  560.     bne.s    FromCLI
  561.     lea    pr_MsgPort(a5),a0
  562.     CALL    WaitPort
  563.     lea    pr_MsgPort(a5),a0
  564.     CALL    GetMsg
  565. FromCLI
  566.     rts
  567.  
  568. disp_req ; subroutine for RT requesters
  569.     lea    tags2(pc),a0
  570.     sub.l    a3,a3
  571.     move.l    xl_rtbase(a4),a6
  572.     move.l    a4,-(sp)
  573.     sub.l    a4,a4
  574.     jsr    _LVOrtEZRequestA(a6)
  575.     move.l    (sp)+,a4
  576.     move.l    xl_dosbase(a4),a6
  577.     rts
  578.  
  579. lockfile ; a0 - strptr on file
  580.     move.l    #ACCESS_READ,d2
  581.     move.l    a0,d1
  582.     move.l    xl_dosbase(a4),a6
  583.     CALL    Lock
  584.     tst.l    d0
  585.     rts
  586.  
  587. execute ; a0 - strptr on command line
  588.     moveq    #0,d2
  589.     moveq    #0,d3
  590.     move.l    a0,d1
  591.     move.l    xl_dosbase(a4),a6
  592.     jmp    _LVOExecute(a6)
  593.  
  594.  
  595. printintro ; unlock, currentdir
  596.     tst.l    xl_introtxt(a4)
  597.     beq    itfromgui
  598.     move.l    xl_introtxt(a4),a0
  599.     bsr    lockfile
  600.     beq    noprintintro
  601.  
  602.     move.l    d0,d1
  603.     CALL    UnLock
  604.  
  605.     move.l    xl_introtxt(a4),a2
  606.     lea    comline3(pc),a0
  607.     bsr    appendcom
  608.     rts
  609.  
  610. itfromgui
  611.     move.l    xl_introfile(a4),xl_txtlock(a4)
  612.     beq    noprintintro
  613.     bsr    printtxt2
  614. noprintintro
  615.     rts
  616.  
  617. printend
  618.     tst.l    xl_endtxt(a4)
  619.     beq    etfromgui
  620.     move.l    xl_endtxt(a4),a0
  621.     bsr    lockfile
  622.     beq    noprintend
  623.  
  624.     move.l    d0,d1
  625.     CALL    UnLock
  626.  
  627.     move.l    xl_endtxt(a4),a2
  628.     lea    comline3(pc),a0
  629.     bsr    appendcom
  630.     rts
  631.  
  632. etfromgui
  633.     move.l    xl_endfile(a4),xl_txtlock(a4)
  634.     beq    noprintend
  635.     bsr    printtxt2
  636. noprintend
  637.     rts
  638.  
  639. printtxt2 ; lock in xl_txtlock(a4)
  640.     lea    comline3(pc),a0
  641.     bsr    appendsub
  642.  
  643.     move.l    a1,d2
  644.     move.l    #255,d3
  645.     sub.l    d0,d3
  646.     move.l    xl_txtlock(a4),d1
  647.     CALL    NameFromLock
  648.  
  649.     lea    xl_typecom_buff(a4),a0
  650.     bsr    execute
  651.     rts
  652.  
  653. ;dispbuffer
  654. ;    lea    xl_typecom_buff(a4),a0
  655. ;    move.l    a0,d1
  656. ;    CALL    PutStr
  657. ;    lea    flush(pc),a0
  658. ;    move.l    a0,d1
  659. ;    CALL    PutStr
  660. ;    rts
  661.  
  662. appendcom ; a0 - beg  a2 - end
  663.     bsr    appendsub
  664.  
  665.     move.l    a2,a0 ; append argument
  666. .loop2
  667.     move.b    (a0)+,(a1)+
  668.     bne.s    .loop2
  669.     lea    xl_typecom_buff(a4),a0
  670.     bra    execute
  671.  
  672. appendsub
  673.     lea    xl_typecom_buff(a4),a1
  674.     moveq    #-1,d0
  675. .loop
  676.     addq    #1,d0
  677.     move.b    (a0)+,(a1)+ ; copy beginning of command in memory
  678.     bne.s    .loop
  679.     tst.b    -(a1)
  680.     rts
  681.  
  682.  
  683. **************************************
  684.  
  685.  
  686. gettotal
  687. ; check if env:xltotal is here - if yes: get it - add to maintotal - del it -
  688. ; (maintotal's will be added to have the real total, in case of multiple dirs)
  689.  
  690.     lea    varfname(pc),a0
  691.     bsr    lockfile
  692.     beq    endsubr
  693.  
  694.     move.l    d0,d1
  695.     CALL    UnLock
  696.  
  697.     moveq    #VARSIZE,d0
  698.     move.l    #$10001,d1
  699.     move.l    a6,-(sp)
  700.     move.l    4.w,a6
  701.     CALL    AllocVec
  702.  
  703.     move.l    (sp)+,a6
  704.     tst.l    d0
  705.     beq    endsubr
  706.  
  707.     move.l    d0,xl_varbuff(a4)
  708.     move.l    d0,d2
  709.     moveq    #VARSIZE,d3
  710.     lea    varname(pc),a0
  711.     move.l    a0,d1
  712.     move.l    #GVF_GLOBAL_ONLY,d4
  713.     CALL    GetVar
  714.  
  715.     move.l    xl_varbuff(a4),d1
  716.     lea    xl_onedirtot(a4),a0
  717.     move.l    a0,d2
  718.     CALL    StrToLong
  719.  
  720.     move.l    xl_statfh(a4),d1
  721.     lea    mtotfmt(pc),a0
  722.     move.l    a0,d2
  723.     lea    xl_dirtoscan(a4),a0
  724.     move.l    a0,d3
  725.     CALL    VFPrintf
  726.     move.l    xl_statfh(a4),d1
  727.     moveq    #0,d2
  728.     move.l    #OFFSET_END,d3
  729.     CALL    Seek
  730.  
  731.     bsr    getbig
  732.  
  733.     lea    varfname(pc),a0
  734.     move.l    a0,d1
  735.     CALL    DeleteFile
  736.  
  737.     lea    basevar(pc),a0
  738.     move.l    a0,d1
  739.     CALL    DeleteFile
  740.  
  741.  
  742. freevbuff
  743.     move.l    xl_varbuff(a4),a1
  744.     move.l    a6,-(sp)
  745.     move.l    4.w,a6
  746.     CALL    FreeVec
  747.     move.l    (sp)+,a6
  748.  
  749. endsubr
  750.     rts
  751.  
  752.  
  753. deletebigvar
  754.     lea    bigvfname(pc),a0
  755.     move.l    a0,d1
  756.     jmp    _LVODeleteFile(a6)
  757.  
  758.  
  759. getbig
  760.     lea    bigvfname(pc),a0
  761.     bsr    lockfile
  762.     bne    gzdh
  763.  
  764.     lea    bigvname(pc),a0
  765.     move.l    a0,d1
  766.     move.l    xl_varbuff(a4),d2
  767.     moveq    #VARSIZE,d3
  768.     move.l    #GVF_GLOBAL_ONLY,d4
  769.     CALL    SetVar
  770.     rts
  771.  
  772.  
  773. gzdh
  774.     move.l    d0,d1
  775.     CALL    UnLock
  776.  
  777.     moveq    #VARSIZE,d0
  778.     move.l    #$10001,d1
  779.     move.l    a6,-(sp)
  780.     move.l    4.w,a6
  781.     CALL    AllocVec ; will be removed in v1.05, sorry
  782.  
  783.     move.l    (sp)+,a6
  784.     tst.l    d0
  785.     beq    endsub2
  786.  
  787.     move.l    d0,xl_bigvarbuff(a4)
  788.     move.l    d0,d2
  789.     moveq    #VARSIZE,d3
  790.     lea    bigvname(pc),a0
  791.     move.l    a0,d1
  792.     move.l    #GVF_GLOBAL_ONLY,d4
  793.     CALL    GetVar
  794.  
  795.     move.l    xl_bigvarbuff(a4),d1
  796.     lea    xl_bigtotal(a4),a0
  797.     move.l    a0,d2
  798.     CALL    StrToLong
  799.  
  800.     move.l    xl_onedirtot(a4),d0
  801.  
  802.     add.l    d0,xl_bigtotal(a4)
  803.  
  804.     move.l    #MODE_NEWFILE,d2
  805.     lea    bigvfname(pc),a0
  806.     move.l    a0,d1
  807.     CALL    Open
  808.     move.l    d0,xl_varfh(a4)
  809.     move.l    d0,d1
  810.  
  811.     lea    xl_bigtotal(a4),a0
  812.     move.l    a0,d3
  813.     lea    fmtvar(pc),a0
  814.     move.l    a0,d2
  815.     CALL    VFWritef
  816.     move.l    xl_varfh(a4),d1
  817.     CALL    Close
  818.  
  819.     move.l    xl_bigvarbuff(a4),a1
  820.     move.l    a6,-(sp)
  821.     move.l    4.w,a6
  822.     CALL    FreeVec
  823.     move.l    (sp)+,a6
  824.  
  825. endsub2
  826.     rts
  827.  
  828.  
  829. teststat ; void - test if ram:xl_stat.txt is already here
  830.     lea    stattxt(pc),a0
  831.     bsr    lockfile
  832.     bne    unlockstat
  833.  
  834.     lea    stattxt(pc),a0
  835.     bra    openstat
  836.  
  837. unlockstat
  838.     move.l    d0,d1
  839.     CALL    UnLock
  840.     lea    stattxt(pc),a0
  841.     bra    openstat
  842.     rts
  843.  
  844. ;testother
  845. ;    lea    stattxt2(pc),a0
  846. ;    bsr    lockfile
  847. ;    bne    addletter
  848.  
  849. ;    lea    stattxt2(pc),a0
  850.  
  851. openstat
  852.     move.l    a0,d1
  853.     move.l    #MODE_NEWFILE,d2
  854.     CALL    Open
  855.     move.l    d0,xl_statfh(a4)
  856.     rts
  857.  
  858. ;addletter
  859. ;    move.l    d0,d1
  860. ;    CALL    UnLock
  861. ;    lea    stattxt2(pc),a0
  862. ;    add.b    #1,17(a0)
  863. ;    bra    testother
  864.  
  865. closestats
  866.  
  867.     move.l    xl_fib(a4),d2
  868.     move.l    xl_statfh(a4),d1
  869.     CALL    ExamineFH
  870.     move.l    xl_fib(a4),a0
  871.     tst.l    fib_Size(a0)
  872.     beq    nullstats
  873.  
  874.     tst.l    xl_bigtotal(a4)
  875.     beq.s    closestatf
  876.  
  877. ;    move.l    xl_statfh(a4),d1
  878. ;    moveq    #0,d2
  879. ;    move.l    #OFFSET_END,d3
  880. ;    CALL    Seek
  881.     move.l    xl_statfh(a4),d1
  882.     lea    totstat(pc),a0
  883.     move.l    a0,d2
  884.     lea    xl_bigtotal(a4),a0
  885.     move.l    a0,d3
  886.     CALL    VFPrintf
  887.  
  888. closestatf
  889.     move.l    xl_statfh(a4),d1
  890.     beq.s    endclosesub
  891.     CALL    Close
  892.     rts
  893.  
  894.  
  895. nullstats
  896.     move.l    xl_statfh(a4),d1
  897.     beq.s    endclosesub
  898.     CALL    Close
  899.     lea    stattxt(pc),a0
  900.     move.l    a0,d1
  901.     CALL    DeleteFile
  902.  
  903. endclosesub
  904.     rts
  905.  
  906.  
  907. ;---- Routine for "MicroShit's Windoze" compatibility
  908. ;MSLoop
  909. ;    nop ; tricky stuff...
  910. ;    jmp    MSLoop ; avoid bra.s
  911.  
  912. ;-----------------------------------------------------------------------
  913. tags1
  914.     dc.l    RTFI_Flags,FREQF_NOFILES
  915.     dc.l    TAG_END
  916.  
  917. tags2
  918.     dc.l    RT_Underscore,'_'
  919.     dc.l    RTEZ_ReqTitle,title
  920.     dc.l    RTEZ_Flags,4 ; centertext
  921.     dc.l    TAG_END
  922.  
  923. xlistname
  924.     dc.b    'c:'
  925. segname
  926.     dc.b    'xList',0
  927. tmpname
  928.     dc.b    'T:xl_tmp1',0
  929.  
  930. sortedname
  931.     dc.b    'T:xl_tmp4',0
  932.  
  933. stattxt
  934.     dc.b    'RAM:xl_stats.txt',0
  935. ;stattxt2
  936. ;    dc.b    'RAM:xl_stats.txt.a',0 ; 17(an)
  937.  
  938. outname
  939.     dc.b    'RAM:xList_out',0
  940.  
  941. outname2
  942.     dc.b    'RAM:xList_out.a',0 ; 14(an)
  943.  
  944. dummycom
  945.     dc.b    'xList >>RAM:xList_out LF DL COF                     ',0
  946.  
  947. comline1
  948.     dc.b    'List >T:xl_tmp1 lformat "xList >>RAM:xList_out *"%s%s*" LF '
  949.     dc.b    'DL COF                                        " dirs all',0
  950.  
  951. comline2
  952.     dc.b    'Sort >NIL: T:xl_tmp1 to T:xl_tmp4',10,'Execute >NIL:'
  953.     dc.b    ' T:xl_tmp4',0
  954.  
  955. comline3
  956.     dc.b    'Type >>RAM:xList_out ',0
  957.  
  958.  
  959. varfname
  960.     dc.b    'ENV:'
  961. varname
  962.     dc.b    'xlsumtot',0
  963.  
  964. bigvfname
  965.     dc.b    'ENV:'
  966. bigvname
  967.     dc.b    'xlbigtot',0
  968.  
  969. basevar
  970.     dc.b    'ENV:xltotal',0
  971.  
  972. mtotfmt
  973.     dc.b    '                         %-16s  %5s files',10,0
  974. totstat
  975.     dc.b    '                         -----------------------------',10
  976.     dc.b    '                         TOTAL:            %5ld files'
  977. flush
  978.     dc.b    10,0
  979. fmtvar
  980.     dc.b    '%N',0
  981.  
  982. dosname
  983.     dc.b    'dos.library',0
  984. rtname
  985.     dc.b    'reqtools.library',0
  986.  
  987. body1
  988.     dc.b    'Out of memory!',0
  989. button1
  990.     dc.b    '_!?!',0
  991.  
  992. body2
  993.     dc.b    'Welcome to the xList-GUI !',10,10
  994.     dc.b    'You''ll have to choose a',10
  995.     dc.b    'directory to be recursively',10
  996.     dc.b    'scanned, like a "MODS:" partition.',10,10
  997.     dc.b    'Then you''ll have to wait until',10
  998.     dc.b    'this requester is poped up again,',10
  999.     dc.b    'allowing you to scan several dirs.',10
  1000.     dc.b    'The last created list is always',10
  1001.     dc.b    '''RAM:xList_out'', other lists are',10
  1002.     dc.b    'named like ''xList_out.a'',''.b'',...',0
  1003.  
  1004.  
  1005. button2
  1006.     dc.b    '_Let''s go!| :-) |_Quit :(',0
  1007.  
  1008. body3
  1009.     dc.b    'Bad luck! Nothing selected.',0
  1010. button3
  1011.     dc.b    '_Bye|_Main menu',0
  1012.  
  1013. body4
  1014.     dc.b    'Unable to lock your dir.',0
  1015. button4
  1016.     dc.b    '_Try another one|_Quit this lame prog',0
  1017.  
  1018. button4b
  1019.     dc.b    '_Sorry',0
  1020.  
  1021. body5
  1022.     dc.b    'Do you want to:',10
  1023.     dc.b    '- append this dir to the existing file ?',10
  1024.     dc.b    '- write to a new file, by renaming the existing file',10
  1025.     dc.b    'to a new name ?',10
  1026.     dc.b    '(of course, your previous lists WON''T be overwritten!)',0
  1027.  
  1028. button5
  1029.     dc.b    '_Append|_New file|A_bort',0
  1030.  
  1031. body6
  1032.     dc.b    'This tool belongs to the xList project,',10
  1033.     dc.b    'started by Reez/Osmose on July 1995,',10
  1034.     dc.b    'with the BiG help of the followings:',10
  1035.     dc.b    'The Cyborg/NGC & Gryzor',10,10
  1036.     dc.b    'And thanx to these great guys:',10
  1037.     dc.b    'U.D. Mueller, for the XPK package',10
  1038.     dc.b    'Nico François, for the ReqTools stuff',0
  1039.  
  1040. button6
  1041.     dc.b    'I wanna ctc _you!',0
  1042.  
  1043. body7
  1044.     dc.b    'Feel free to write me at: (Answer Guaranteed!!!)',10,10
  1045.     dc.b    'David Le Corfec',10
  1046.     dc.b    '57 rue C.J. Romain',10
  1047.     dc.b    '94170  Le Perreux / Marne',10
  1048.     dc.b    'FRANCE',10,10
  1049.     dc.b    'Email:  <perret@diva.univ-mlv.fr>',10
  1050.     dc.b    ' Thanks to use the following, dating from',10
  1051.     dc.b    '(probable date & address) 10-Oct-95:',10
  1052.     dc.b    '<lecorfec@merlin.univ-mlv.fr>',10,10
  1053.     dc.b    'On IRC: Reez, mainly on #amigafr  (Hi Net-mates!)',0
  1054.  
  1055. button7
  1056.     dc.b    '_OK I see...',0
  1057.  
  1058. body8
  1059.     dc.b    'Cannot find ''xList'' in your path.',10
  1060.     dc.b    'Be sure to install it properly !',10
  1061.     dc.b    '(in your C: drawer, for example)',0
  1062.  
  1063. button8
  1064.     dc.b    '_Be right back...',0
  1065.  
  1066. body9
  1067.     dc.b    'Here you can choose intro and end texts for your list',0
  1068.  
  1069. button9
  1070.     dc.b    '_Next step!|Choose _Intro|Choose _End',0
  1071.  
  1072. button10
  1073.     dc.b    '_Uh?',0
  1074.  
  1075. body11
  1076.     dc.b    'Add a listing of the root directory ?',10
  1077.     dc.b    '(the directory you selected)',0
  1078.  
  1079. button11
  1080.     dc.b    'Oh _yeah!|_No, thanx.',0
  1081.  
  1082. text1
  1083.     dc.b    'Select a directory to list:',0
  1084.  
  1085. text2
  1086.     dc.b    'Select text:',0
  1087.  
  1088. template
  1089.     dc.b    'DIR(S)/M,IT=INTROTEXT/K,ET=ENDTEXT/K,APPEND/S,NOROOT/S',0
  1090. ; these ET and IT args are not used in v1.04. Still some problems...
  1091.  
  1092.     end
  1093.